﻿namespace Raven
{
    public abstract class FuzzySet
    {
        protected Fix _dom;
        protected Fix _representativeValue;

        public FuzzySet(Fix repVal)
        {
            _dom = 0;
            _representativeValue = repVal;
        }

        public abstract Fix CalculateDOM(Fix val);

        public void ORwithDOM(Fix val)
        {
            if (val > _dom)
            {
                _dom = val;
            }
        }

        public Fix GetRepresentVal()
        {
            return _representativeValue;
        }

        public void ClearDOM()
        {
            _dom = 0;
        }

        public Fix GetDOM()
        {
            return _dom;
        }

        public void SetDOM(Fix val)
        {
            Utility.Assert(val <= 1 && val >= 0, "<FuzzySet::SetDOM>: invalid value");
            _dom = val;
        }
    }
}